import 'package:flutter_deer/generated/json/base/json_convert_content.dart';
import 'package:flutter_deer/net/base_entity.dart';

BaseApiDataEntity $BaseApiDataEntityFromJson(Map<String, dynamic> json) {
  final BaseApiDataEntity baseApiDataEntity = BaseApiDataEntity();
  final bool? ifQuery = jsonConvert.convert<bool>(json['ifQuery']);
  if (ifQuery != null) {
    baseApiDataEntity.ifQuery = ifQuery;
  }
  final String? sql = jsonConvert.convert<String>(json['sql']);
  if (sql != null) {
    baseApiDataEntity.sql = sql;
  }
  final String? time = jsonConvert.convert<String>(json['time']);
  if (time != null) {
    baseApiDataEntity.time = time;
  }
  final bool? success = jsonConvert.convert<bool>(json['success']);
  if (success != null) {
    baseApiDataEntity.success = success;
  }
  final String? errorMsg = jsonConvert.convert<String>(json['errorMsg']);
  if (errorMsg != null) {
    baseApiDataEntity.errorMsg = errorMsg;
  }
  final int? affectedRows = jsonConvert.convert<int>(json['affectedRows']);
  if (affectedRows != null) {
    baseApiDataEntity.affectedRows = affectedRows;
  }
  final List<String>? columns =
      jsonConvert.convert<List<String>>(json['columns']);
  if (columns != null) {
    baseApiDataEntity.columns = columns;
  }
  final List<dynamic>? rowData =
      jsonConvert.convert<List<dynamic>>(json['rowData']);
  if (rowData != null) {
    baseApiDataEntity.rowData = rowData;
  }
  return baseApiDataEntity;
}

Map<String, dynamic> $BaseApiDataEntityToJson(BaseApiDataEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['ifQuery'] = entity.ifQuery;
  data['sql'] = entity.sql;
  data['time'] = entity.time;
  data['success'] = entity.success;
  data['errorMsg'] = entity.errorMsg;
  data['affectedRows'] = entity.affectedRows;
  data['columns'] = entity.columns;
  data['rowData'] = entity.rowData;
  return data;
}
